#ifndef CSelect_h
#define CSelect_h

#include "Assert_me.h"
#include <tchar.h>
class CSelect
{
    typedef int State_t;
public:
    CSelect(const State_t nMax, const State_t nMin=0):mMin(nMin),mMax(nMax),mState(nMin){}
    ~CSelect(){}
public:
    State_t GetState()const { return mState; }
    void Next() { ++mState; if(mState==mMax) mState=mMin; }
    void Last() { --mState; if(mState==mMin-1) mState=mMax-1; }
    void SetState(const State_t nState)
    {
        ASSERT_STD(nState>=mMin && nState<mMax, 
            _T("CCelect::SetState(const State_t nState)"), _T("ERROR. Out of range") );
        mState=nState;
    }
private:
    State_t mMin, mMax, mState;
};



#endif